<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="../resources/orientation-event-helpers.js"></script>
<script>
'use strict';

sensor_test(async (t, sensorProvider) => {
  const orientationData1 = generateOrientationData(1, 2, 3, false);
  setMockOrientationData(sensorProvider, orientationData1);
  await Promise.all([
    waitForEvent(getExpectedOrientationEvent(orientationData1)),
    waitForEvent(getExpectedOrientationEvent(orientationData1))
  ]);

  const orientationData2 = generateOrientationData(11, 12, 13, false);
  setMockOrientationData(sensorProvider, orientationData2);
  await waitForEvent(getExpectedOrientationEvent(orientationData2));
}, 'Tests using multiple event handlers for the Device Orientation API.');
</script>
